package com.sand.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "community", schema = "ssh_pro", catalog = "")
public class CommunityEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private int cityId;
    private String communityName;
    private String communityAddress;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "cityId")
    public int getCityId() {
        return cityId;
    }

    public void setCityId(int districtId) {
        this.cityId = districtId;
    }

    @Basic
    @Column(name = "communityName")
    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    @Basic
    @Column(name = "communityAddress")
    public String getCommunityAddress() {
        return communityAddress;
    }

    public void setCommunityAddress(String communityAddress) {
        this.communityAddress = communityAddress;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CommunityEntity that = (CommunityEntity) o;
        return rid == that.rid && cityId == that.cityId && Objects.equals(communityName, that.communityName) && Objects.equals(communityAddress, that.communityAddress);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, cityId, communityName, communityAddress);
    }
}
